﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using AntiObesity.Base;
using AntiObesity.Base.Managers;

namespace AntiObesity.Services
{
    /// <summary>
    /// Summary description for $codebehindclassname$
    /// </summary>
    [WebService(Namespace = "http://antiobesity-project.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class FoodExists : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            var name = context.Request["txtFoodName"];
            var food = FoodManager.FindByName(name);
            context.Response.Write(food==null ? "false": "true");
        }

        public bool IsReusable
        {
            get { return false; }
        }
    }
}
